<template>
	<view>
		<u-tabbar v-model="current" :before-switch="beforeSwitch" :list="list" :mid-button="true"></u-tabbar>
	</view>
</template>

<script>
	export default {
		name:"tabbar",
		data() {
			return {
				list: [{
					pagePath: "/pages/home/home",
					iconPath: "home",
					selectedIconPath: "home-fill",
					text: '首页',
					customIcon: false,
				},
				{
					pagePath: "/pages/help/help",
					iconPath: "/static/icon/tabbar/help.png",
					selectedIconPath: "/static/icon/tabbar/help-active.png",
					text: '帮忙',
					midButton: true,
					customIcon: false,
				},
				{
					pagePath: "/pages/mine/mine",
					iconPath: "account",
					selectedIconPath: "account-fill",
					text: '我的',
					isDot: false,
					customIcon: false,
				},
			],
			current: 0
				
			};
		},
		methods:{
			beforeSwitch(index) {
				// 只能切换偶数项
				if(index % 2 == 0) return true;
				else return false;
			}
		}
	}
</script>

<style>

</style>
